﻿using System;
using MaLu.Data;
using System.Data;
using MaLu.Common;
using MaLu.Framework.Common;

namespace MaluJg.web.Move
{
    public partial class item3 : MovePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = SqlHelper.Instance.ExecuteDataTable(Provider, "select  * from moving where id=" + MID);
                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    tb1.Text = dr["Di1"].ToString();
                    tb2.Text = dr["Di2"].ToString();
                    tb3.Text = dr["Di3"].ToString();
                    tbThirdRemark.Text = dr["ZhiFuRemark"].ToString();
                 
                }
            }
        }
    
        protected void btnSave_Click(object sender, EventArgs e)
        {

            string sql = string.Format(@"UPDATE [Moving]
   SET [Di1] ={0}
      ,[Di2] ={1}
      ,[Di3] = {2}
      ,[ZhiFuRemark] = {3},Third=1 where ID={4}", Util.ReturnSqlValue(tb1.Text), Util.ReturnSqlValue(tb2.Text),
                                   Util.ReturnSqlValue(tb3.Text), Util.ReturnSqlValue(tbThirdRemark.Text),MID);
            SqlHelper.Instance.ExecuteNonQuery(Provider, sql);


            ClientScript.RegisterStartupScript(this.GetType(), "Close", "<script>alert('成功保存!');</script>");
        }
    }
}
